package com.example.zg3

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.alibaba.android.arouter.launcher.ARouter
import com.blankj.utilcode.util.ToastUtils
import com.example.base.mvvm.BaseActivity
import com.example.zg3.databinding.ActivityMainBinding
import com.example.zg3.login.LoginViewModel
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MainActivity : BaseActivity<ActivityMainBinding,LoginViewModel>() {
    override fun initData() {
        vm.success.observe(this){
            ToastUtils.showLong("登录成功")
            ARouter.getInstance().build("/app/NoticeActivity").navigation()
        }
    }

    override fun initView() {
        binding.btnEncrypt.setOnClickListener {
            vm.login(binding.et1.text.toString(),  binding.et2.text.toString())
        }
    }

}

